<include file="Public/header" />
<include file="Public/menu" />

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            商品
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 商品管理</a></li>
            <li class="active">自提点列表</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content">
    	<div class="row">
        	<div class="col-md-12">
            	<div class="box">
                    <div class="box-header">
                        <h3 class="box-title">自提点列表</h3>

                        <!--<div class="form-inline pull-right">
                            <form action="/Qgs/auth/menu" method="get" pjax-container="">
                                <fieldset>
                                    <div class="input-group input-group-sm">
                                        <span class="input-group-addon"><strong>Id</strong></span>
                                        <input type="text" class="form-control" placeholder="Id" name="id" value="">
                                    </div>
            
                                    <div class="input-group input-group-sm">
                                        <div class="input-group-btn">
                                            <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>
                                        </div>
                                    </div>
            
                                </fieldset>
                            </form>
                        </div>-->
            
            
                        <div class="btn-group pull-right" style="margin-right: 10px">
                            <a href="{:U('Qgs/StoreDot/add')}" class="btn btn-sm btn-success"><i class="fa fa-save"></i>&nbsp;&nbsp;新增</a>
                        </div>
            
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th><input type="checkbox" class="grid-select-all"></th>
                                <th>ID</th>
                                <th>自提点名称</th>
                                <th>详细地址</th>
                                <th>提货时间说明</th>
                                <th>联系电话</th>
                                <th>操作</th>
                            </tr>
                            <?php foreach($storeDotMsg as $v){ ?>
                            <tr>
                                <td><input type="checkbox" class="grid-item" data-id="1"></td>
                                <td>{$v['dot_id']}</td>
                                <td>{$v['store_dot_name']}</td>
                                <td>{$v['addr']}</td>
                                <td>{$v['tihuo_time']}</td>
                                <td>{$v['tel']}</td>
                                <td>
                                    <a href="{:U('Qgs/storeDot/edit',array('dot_id'=>$v['dot_id']))}"><i class="fa fa-edit"></i></a>
                                    <a onclick="if(confirm('确定删除?')==false)return false;" href="{:U('Qgs/storeDot/delete',array('dot_id'=>$v['dot_id']))}"><i class="fa fa-trash"></i></a>
                                </td>
                            </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <input type="checkbox" class="grid-select-all">&nbsp;&nbsp;&nbsp;
            
                        <a class="btn btn-sm btn-primary grid-refresh"><i class="fa fa-refresh"></i></a>
            
                        {$page}
                    </div>
                 </div>
            </div>
        </div>
    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer" />

        <script data-exec-on-popstate>

            $(function () {

                $('.grid-select-all').change(function() {
                    if (this.checked) {
                        $('.grid-item').prop("checked", true);
                    } else {
                        $('.grid-item').prop("checked", false);
                    }
                });

                $('.batch-delete').on('click', function() {
                    var selected = [];
                    $('.grid-item:checked').each(function(){
                        selected.push($(this).data('id'));
                    });

                    if (selected.length == 0) {
                        return;
                    }

                    if(confirm("Are you sure to delete this item ?")) {
                        $.post('/Qgs/auth/roles/' + selected.join(), {_method:'delete','_token':'ALpaP7hXZ6s2dnAdE02Z6mUSHPt8RkYbcDRp6rpw'}, function(data){
                            $.pjax.reload('#pjax-container');
                            noty({
                                text: "<strong>Succeeded!</strong>",
                                type:'success',
                                timeout: 1000
                            });
                        });
                    }
                });
            });
        </script>